package Service;

import java.util.List;

import Dao.FriendDao;
import Dao.StatusDao;
import Dao.WeiboFriend;
import Dao.WeiboStatus;
import Data.Status;
import Data.UserFriend;

public class WeiboService {
    
    private String userId ;
    
    private String platform ;
    
    private Status statu ;
    
    private List<Status> status ;
    
    private List<UserFriend> userFriend ;
    
    private StatusDao statusDao ;
    
    private FriendDao friendDao ;
    
    public WeiboService( String userId , String platform ){
	this.userId = userId ;
	this.platform = platform ;
    }

    public String getUserId() {
        return userId;
    }

    public List<Status> getStatus() {
	status = getStatusDao().queryStatus(userId) ;
        return status ;
    }

    public List<UserFriend> getUserFriend() {
	userFriend = (getFriendDao().queryFriend(userId)) ;
        return userFriend;
    }

    public StatusDao getStatusDao() {
	switch (platform) {
	case "Weibo":
	    statusDao = new WeiboStatus() ;
	    break;

	default:
	    break;
	}
        return statusDao;
    }

    public void setStatusDao(StatusDao statusDao) {
        this.statusDao = statusDao;
    }

    public FriendDao getFriendDao() {
	switch (platform) {
	case "Weibo":
	    friendDao = new WeiboFriend() ;
	    break;

	default:
	    break;
	}
        return friendDao;
    }

    public void setFriendDao(FriendDao friendDao) {
        this.friendDao = friendDao;
    }   
    
}
